float4x4 xViewProjection;
float4 xMousePos;
sampler TextureSampler;

struct VS_OUTPUT
{
	float4 Position : POSITION;
	float2 TexCoords : TEXCOORD0;
	float4 pos : TEXCOORD3;
};


VS_OUTPUT vertexMain(float4 inPos : POSITION, float2 inTexCoords : TEXCOORD0)
{
	VS_OUTPUT Output = (VS_OUTPUT)0;

	Output.Position = mul(inPos, xViewProjection);
	Output.TexCoords = inTexCoords;
	Output.pos = inPos;

	return Output;
}

struct PS_OUTPUT
{
	float4 Color : COLOR0;
};

PS_OUTPUT pixelMain(VS_OUTPUT PSIn)
{
	PS_OUTPUT Output = (PS_OUTPUT)0;

	Output.Color = tex2D(TextureSampler, PSIn.TexCoords);
	Output.Color.a /= (distance(xMousePos, PSIn.pos) / 8.0f) + 0.5f;

	return Output;
}